﻿//-----------------------------------------------------------------
//
// @(#)$Id: InventoryListReport.aspx.cs,v 1.0 2013/12/16 9:49:58 lichunhua Exp $
// @(#)$Author: lichunhua  $
// @(#)$Date: 2013/12/16 9:49:58 $
// @(#)$Description:
//
//
//
//                 All Rights Reserved.
//-----------------------------------------------------------------
using System;
using System.Data;
using System.Web.UI.WebControls;
using ebay.Dal;

public partial class UI_Report_InventoryListReport : System.Web.UI.Page
{
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        //ddlSales.Items.Insert(0, new ListItem("《--请选择--》", " "));
        //ddlSales.Items.Insert(1, new ListItem("是", "是"));
        //ddlSales.Items.Insert(2, new ListItem("否", "否"));
        ddlSales.Items.Insert(0, new ListItem("《--请选择--》", ""));
        ddlSales.Items.Insert(1, new ListItem("中国直发仓库", "中国直发仓库"));
        ddlSales.Items.Insert(2, new ListItem("英国直发库", "英国直发库"));
        ddlSales.Items.Insert(3, new ListItem("中国英国空运仓库", "中国英国空运仓库"));
        ddlSales.Items.Insert(4, new ListItem("中国英国海运仓库", "中国英国海运仓库"));
        ddlSales.Items.Insert(5, new ListItem("海运移动仓库", "海运移动仓库"));
        ddlSales.Items.Insert(6, new ListItem("空运移动仓库", "空运移动仓库"));
        ddlSales.Items.Insert(7, new ListItem("中国德国直发仓库", "中国德国直发仓库"));
        ddlSales.Items.Insert(8, new ListItem("中国样品库", "中国样品库"));
        ddlSales.Items.Insert(9, new ListItem("中国浦东样品库", "中国浦东样品库"));
        ddlSales.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        WebUtility.CheckRight();
        if (!IsPostBack)
        {
           
        }
    }  
    protected void btnExport_Click(object sender, EventArgs e)
    {
        if (Session["UserId"] == null)
        {
            WebUtility.ShowMsg("登陆超时,请重新登陆", this);
            return;
        }
        string psfication = txtProductSpecification.Value;
        string sales = ddlSales.Value;
        /*原中间平台语句
        Report ag = new Report();        
        // DataTable table = ag.GetInventory();
        DataTable table = ag.GetInventory(psfication, sales);
        */
        Report ag = new Report();
        // DataTable table = ag.GetInventory();
        DataTable table = ag.GetInventory(psfication, sales);

        if (table != null)
        {
            DataSetToExcel.DataSetOutExcel(table, "库存一览表");
        }
        else
        {
            WebUtility.ShowMsg("无数据", this);

        }
    }    
}
